package xiaohu.ODImportant;

import java.util.Scanner;

public class _04 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            String strS = in.nextLine();
            String strT = in.nextLine();
            if (strS.length() > strT.length()) {
                System.out.println(false);
                return;
            }

            for (int i = 0; i < strS.length(); i++) {
                int index = strT.indexOf(strS.charAt(i));
                if (index >= 0 && index < strT.length()) {
                    strT = strT.substring(index + 1);
                    continue;
                } else {
                    System.out.println(false);
                    return;
                }
            }
            System.out.println(true);
        }
    }
}
